home *** CD-ROM | disk | FTP | other *** search
/ PC-X 1997 October / pcx14_9710.iso / swag / delphi.swg / 0019_'navigating' a TMemo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-11-22  |  369 b   |  12 lines

  1.  
  2. to determine position of cursor in edit field try this:
  3.  
  4. Lpos := SendMessage(memo1.Handle,EM_LINEFROMCHAR,Memo1.SelStart,0);
  5. Cpos := SendMessage(memo1.Handle,EM_LINEINDEX,Lpos,0);
  6. LineLength := SendMessage(memo1.handle, EM_LINELENGTH, Cpos, 0);
  7. CPos := Memo1.SelStart-CPos;
  8.  
  9. Lpos=line position
  10. Cpos=Cposition
  11. LineLength = number of chacters in currentline
  12.